package apiDay02;


public class RegDemo06 {
    public static void main(String[] args) {
        String reg="(\\d{1,3}\\.){3}(\\d{1,3})";
        String ip1="192.168.2.70";
        String ip2="10.0.0.70";
        String ip3="8.8.8.8";
        String ip4="192点168点2点70";
        String ip5="192-168-2-70";
        String []a =ip1.split("\\.");
        for (int i = 0; i <a.length; i++) {
            System.out.println(a[i]);
        }
        System.out.println(ip1);
        System.out.println(ip1.matches(reg));
        System.out.println(ip2.matches(reg));
        System.out.println(ip3.matches(reg));
        System.out.println(ip4.matches(reg));
        System.out.println(ip5.matches(reg));








        /*
        String a ="www.tedu.cn";
        String s1 ="www.tedu.cn";
        String s2 ="wwwAteduAcn";
        String s3 ="www-tedu-cn";
        System.out.println(s1.matches(a));
        System.out.println(s2.matches(a));
        System.out.println(s3.matches(a));


         */



        /*
        String reg="Hello\\s+World";
        String s1="HelloWorld";
        String s2="HelloWorld1";
        String s3="Hello    World";
        String s4="123";
        String s5="你好";
        System.out.println(s1.matches(reg));
        System.out.println(s2.matches(reg));
        System.out.println(s3.matches(reg));
        System.out.println(s4.matches(reg));
        System.out.println(s5.matches(reg));

         */
    }


}
